package com.link2room.optimus.facade.impl;

import com.link2room.common.constant.DefaultValue;
import com.link2room.common.dto.param.base.BaseL2rParamDto;
import com.link2room.common.jpa.result.QueryResult;
import com.link2room.common.service.ICommonService;
import com.link2room.common.util.ClassConverUtil;
import com.link2room.optimus.entity.PriceBase;
import com.link2room.optimus.dto.result.base.PriceBaseDto;
import com.link2room.optimus.facade.IPriceBaseFacadeService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by sss on 2016/8/31.
 */
@Component("priceBaseFacadeService")
public class PriceBaseFacadeServiceImpl implements IPriceBaseFacadeService {
    @Resource
    private ICommonService commonService;

    /**
     * 列出价格代码列表
     * @param baseL2rParamDto
     * @return
     * @throws Exception
     */
    @Override
    public QueryResult<PriceBaseDto> listPriceBases(BaseL2rParamDto baseL2rParamDto)throws Exception{
        PriceBase queryPB=new PriceBase();
        queryPB.setLhotelGroupCode(baseL2rParamDto.getLhotelGroupCode());
        queryPB.setIsHalt(DefaultValue.F);
        QueryResult<PriceBase> priceBaseResult = commonService.findAllEQ(PriceBase.class, queryPB);
        return ClassConverUtil.copyQueryResultToDtoQueryResult(priceBaseResult, PriceBaseDto.class, false);
    }

}
